package models

import (
	"github.com/goravel/framework/database/orm"
)

// 工时记录表
type Record struct {
	orm.Model
	RepairID uint    `gorm:"column:repair_id;type:bigint(20) unsigned;not null;comment:报修单ID;index:repair_id" form:"repair_id" json:"repair_id"`
	TicketID uint    `gorm:"column:ticket_id;type:bigint(20) unsigned;not null;comment:工单ID;index:ticket_id" form:"ticket_id" json:"ticket_id"`
	UserID   uint    `gorm:"column:user_id;type:bigint(20) unsigned;not null;comment:用户ID;index:user_id" form:"user_id" json:"user_id"`
	User     User    `gorm:"foreignKey:user_id;references:id" form:"user" json:"user"`
	Ticket   Ticket  `gorm:"foreignKey:ticket_id;references:id" form:"ticket" json:"ticket"`
	Repair   Repair  `gorm:"foreignKey:repair_id;references:id" form:"repair" json:"repair"`
	Score    float64 `gorm:"column:score;type:decimal(10,2);not null;comment:工时分" form:"score" json:"score"`
	orm.SoftDeletes
}
